﻿using System;
using System.Data;
using CodeGenerator.interfaces;

namespace CodeGenerator.Implementations
{
    public class DatabaseColumn : IDatabaseColumn
    {
        private string _columnName = "";
        private Type _dataType;
        private bool _isIdentity = false;
        private string _dataBaseTypeName="";
        private string _maxLength = "";
        private string _precision = "";
        private string _scale = "";

        public DatabaseColumn(string ColumnName, Type dataType, bool IsIdentity, string DataBaseTypeName, string MaxLength, string Precision, string Scale)
        {
            _dataBaseTypeName = DataBaseTypeName;
            _isIdentity = IsIdentity;
            _dataType = dataType;
            _columnName = ColumnName;
            _maxLength = MaxLength;
            _precision = Precision;
            _scale = Scale;
        }

        public DatabaseColumn(string ColumnName, Type dataType)
        {
            _dataType = dataType;
            _columnName = ColumnName;
         
        }

        string IDatabaseColumn.ColumnName
        {
            get { return _columnName; }
        }

        string IDatabaseColumn.MaxLength
        {
            get { return _maxLength; }
        }

        public string Precision {
            get { return _precision; }
        }
        public string Scale {
            get { return _scale; }
        }
        public Type DataType
        {
            get { return _dataType; }
        }

        public string DataBaseTypeName
        {
            get { return _dataBaseTypeName; }
        }

        public bool IsIdentity
        {
            get
            {
                return _isIdentity;
            }
        }
    }
}